package com.tancw.tag;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;

public class PeTag extends TagSupport {
    private PageContext pageContext;
    private String name;

    @Override
    public void setPageContext(PageContext pageContext) {
        this.pageContext = pageContext;
    }

    @Override
    public int doStartTag() throws JspException {
         super.doStartTag();
         return 1;
    }

    @Override
    public int doEndTag() throws JspException {
        try {
            PrintWriter writer = pageContext.getResponse().getWriter();
            writer.print("自定义page23");
        } catch (IOException e) {
            e.printStackTrace();
        }
        return 6;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
